There are a number of good projects on the web with code on driving a Hobby servo with a PIC.
Google "PIC servo:, "PIC servo controller", ""PIC servo controller project", "PIC servo controller tutorial" to find them.
Her is one that uses an 18F PIC and is written in C.http://www.instructables.com/id/Use-a-PIC-Microcontroller-to-Control-a-Hobby-Servo/
However, most are in assembler and for a different PIC but the technique is the same. You will need to learn enough PIC assembler (see data sheet for assembler Instruction Set) to port the code to C and you will also need to learn the details of the PIC you are using, the PIC16F8452, to properly setup the PIC.
A good starting point for learning how to use and program PICs is here:http://www.gooligum.com.au/tutorials.html