You can find the factory service manual specific to your Subaru vehicle including trouble shooting error codes and wiring diagrams over
This manual describes P0500 on page 2958 as related to either the ABS warning light OR a wiring problem, I've pasted the section below.
For part and loom ...
P0500 on the H6 engine is, as you say, a Vehicle Speed Sensor. Check your ABS sensors on each of the front wheels.
Here's the usual cause for a P0500 error;
Check the ABS tone wheel on each front wheel, plus the connector wiring to it. The sensors themselves are usually pretty reliable unless they're damaged by removing the hub.