You may use Seven Segment Display
example for EasyPIC5
as a good start for your project. You may download examples written for PIC16F877A
and do the necessary adjustments for your chip.
You should also take a look at the schematic of how 7 segment LED display is connected on EasyPIC5 board, so you might consider adjusting your hardware accordingly. Here's the part of manual related to this: