First, to generate the sinewave, vary the duty cycle as a function of Sin(πft) and then run the PWM output through a low pass filter.
To vary the amplitude, multiply the duty cycle values by an "amplitude factor" before feeding them to the PWM generator. D = A*Sin(πft) where 0 ≤ A ≤ 1 and 'D' is the duty cycle value (or PWM "on time").
Steve has covered this quite well, but put more simply, a low pass filter will remove the (carrier which is PWM Modulated), The wave form recovered from the low pass filter will be determined by what went into the PWM modulator to start with. The recovered signal will be the same.
And the simplest low-pass filter is a resistor followed by a capacitor to ground. It, basically forms a voltage divider with a passive component on top -- i.e. the resistor -- and a frequency dependent component on the bottom -- i.e. the capacitor. The capacitor has a higher effective resistance for lower frequencies and vice-versa. Thus, for higher frequencies, the voltage divider has a low voltage output (thus the high frequency component is essentially shunted to ground), and for lower frequencies, the voltage output is much higher (i.e lower frequency component is passed through with little attenuation). The output of the voltage divider, BTW is taken at the point between the resistor and the capacitor.