In previous versions of Windows (before Vista / W7) a format of the hard drive did not clear everything off the drive, so files could still be there (but hidden).
i believe in Vista / W7 a format now writes data onto the disk so deleting all the old files. However anyone who REALLY wanted to get at the data (police etc) could probably still do it with special software.
However I think for general use a restore to factory settings is probably good enough, unless you had some very personal stuff on the computer.
A free product called CCleaner now has an option (called Drive Wiper) to delete all the "hidden" files on the unused portion of the disk (it cant delete Windows itself of course as Windows will be running, but will clear out the unused portion of the disk).
It may be a good idea to use this BEFORE doing a restore (to delete many of your old deleted files), THEN do a restore to factory settings.
That should be enough to stop all but the most determined person.
Here is CCleaner web site
http://www.piriform.com/ccleaner