Does anyone know any code that will do that or give me a starting place to play with?
I like this one. http://www.rentron.com/PICX2.htm

It is a little more complicated than ADCIN, but it is still the method I use.
Follow the code with the data sheet and it should become clear how the ADC works. Complete control.