Generating sine wave signal using PIC1xf series is a common project in internet but most of the source code is written in assembly language. Assembly language is good and efficient but it is not portable as C language. This blog show how to generate sine wave using c language.
http://electronictoofree.blogspot.my/2016/12/pic18f-dual-pwm-sinusoidal-pwm.html