It's really not that big of a deal. Just use the same ground and supply for the GP2D12 as you're using for your PIC (presuming 5V regulated). Connect the third pin of the GP2D12 to the PIC A/D pin of your choice. Set the pin A/D input, read the incoming variables, and write code to suit your application as needed.
Check the datasheet (especially the volts vs. distance graph) for the GP2D12 though while you're experimenting with it. Note that while you're really close to the GP2D12, or when you start to move to the farthest of its range, the readings become erratic and unusable. That's okay, just plan your physical design (e.g. robot wall detection) to work within those limits.
You may also find for detection of a stationary object, the GP2D12 output will fluctuate slightly. That's okay, but the preferred way to compensate seems to be to take an average of several (maybe ten or so) readings, as oppose to using a capacitor to smooth the output.
[ [/B]