pwm_component
If you put PWM through a low-pass filter, you will get an average voltage, that's proportional to the duty cycle of PWM.
Generating PWM with analog is a little more complex. You generate a triangualr or sawtooth wave and runt it through an analog threshold comparator. By varying the threshold voltage you vary the PWM duty cycle. There are a lot of ICs that are built for this purpose. DigiKey has about 2000 ICs in the PWM section.
Also take a look at this **broken link removed**