1) You will need a second hard drive or a lot of USB drives. While you could do all this with just the 1 drive, as you recover files, you will be erasing files the software hasn't gotten to yet.
if you have a second hard drive, install it as the primary hard drive with the formatted disk removed from the computer (XP sometimes has trouble if you remove a drive that was present during install)
once you have an operating system up and running you will need put the drive back in the computer so u can get at its files.
2) Now you will need recovery software.
Assuming you installed windows, i would recamend Pandora Recovery or Odin. both are free and easy to use.
3) Recover the files from the formatted drive to the new drive.
Now...
if you don't have a spare hard drive what you can do is create a Linux Live bootable CD or USB disk
Download Kubuntu and Linux Live USB Creator (Lili)
Use lili to create a bootable linux live disk with persistence
Once booted into linux you can open Muon software center and install recovery software A simple tool to use is Magic Rescue. if Muon fails to install magic rescue for whatever reason you can open a Terminal window from the Kickoff menu (Start menu) and type
sudo apt-get install magicresue
run the recovery software and have it save recovered files to USB drives, or to another computer over the network.