Variable PWM for a PIC18F4550?
To step through through various duty cycles, such as incrementing 10% each period, you need to set up an interrupt on the Timer Overflow. In that interrupt services routine, you modify the PWM duty cycle register to it's new value.

To update the duty cycle based on a switch, you do the same thing. Set up an interrupt on the input pin connected to the switch and again update the duty cycle registers during that interrupt service routine.

Here is a Microchip Tutorial on Timer interrupts including some C code. And here is the Microchip Application Note on the Capture/Compare/PWM peripheral. The examples are in Assembly. But you say you've already set up the PWMs so you should already be familiar with which registers you need to modify to change the duty cycle.