PIC16F77 ADC not producing 0v result with 0v input
I was researching this same problem I was having with a PIC ADC and  came across this old thread. It led me to try something different to what is discussed here and voila it worked. So I guess an update to this old thread is in order. 

I tried changing the TRIS register as discussed here but with mixed results on a PIC12F1840 - it solves the minimum reading but when connecting the pin to VDD the reading is lower than the expected 0x3FF. I had WPU enabled on the pin so I changed WPU to OFF and voila, problem solved. Both min and max readings are correct. eg WPUAbits.WPUA0 = 0. 

Kinda makes sense if you think about it but nowhere that I could find is it mentioned to beware of in the datasheet when configuring an ADC input.

Readings across the range are also affected - except at input = VDD which gives the correct ADC result of 0x3FF. Clearly current flowing through the 20k-100k WPU device combined with the high input impedance of the ADC port upsets the ADC reading. 

Default state for WPUs are disabled through WPUEN bit so I guess you can call it a misconfiguration of the ADC pin on my part but with no warnings in the datasheet.

This may well also be true for other devices with WPU such as the OP's 16F77 which has WPU on PortB. Probably too long ago to be relevant to him now tho, hopefully other folk will find this helpful.