
labIII, the Laboratory for Experimental Computer Science at the Academy of Media Arts Cologne, posted this tutorial on how to generate sine waves with an Arduino using the Direct Digital Synthesis method. They explain:
Here we describe how to generate sine waves with an Arduino board in a very accurate way. Almost no additional hardware is required. The frequency range reaches form zero to 16 KHz with a resolution of a millionth part of one Hertz! Distortions can be kept less than one percent on frequencies up to 3 KHz. This technique is not only useful for music and sound generation another range of application is test equipment or measurement instrumentation. Also in telecommunication the DDS Method is useful for instance in frequency or phase modulation (FSK PSK).

Heh, tried that sketch out on my Arduino a couple of weeks ago. Sadly I didn’t have any suitable inductors to build the proper filter with; they don’t seem to be a common toolbox component. A simple R-C lowpass filter seemed to vaguely work, but your mileage may vary.
Why on earth are they using PWM to do this? They get up to 16kHz output and the sine looks no better than you would get with an 8-bit R2R ladder D/A without any filtering!
I would do this with a sine (or any other waveform) look-up table. An Arduino with a 20MHz clock, 8 bit look-up table, 8-bit linear R2R ladder A/D, and a 24 bit accumulator should be able to produce a decent sine wave through around 100-200KHz with sub-Hertz step size and no need for an output filter. That is, if you program in assembler and take care to minimize the number of clock cycles used (RISC AVR’s are nice for this because most instructions execute in one clock cycle). This has been done before – many times.