PIC 18f4685 and Hitachi 44780 LCD
You can get code that is known to work, but it will not be guaranteed to work on your particular hardware configuration. You will need to configure the code and maybe even modify it.

A couple of years ago, I wrote a simple LCD library. At the time, I used PIC18F4450, but I have also tried this code on PIC16F887. It should work with many chips, as long as you know what you do. To make things easy for you, it also has an example main.c file.