what you can do is go to the store tab on itunes and look for an icon marked "purchased" there it will have all the music, tv shows, app, and books that you have purchased will be available for you to redownload now keep in mind for the apps any apps that you have purchased in the past not all of them may be available to be redownloaded
First, launch iTunes. From the menu bar click Store / Authorize This Computer.
If your iTunes purcahses are on your iPhone, connect the iPhone to your computer. Select it under Devices left side of the iTunes window then from the menu bar click File / Transfer Purchases From...
If you never synced your iTunes purchases to your iPhone, you can re download your purchases for free if you are a U.S. resident and have iTunes 10.3 or higher installed.
The transfer of content from sources such as songs imported from CD is designed by default to be one way from iTunes to iPod. However there are a number of third party utilities that you can use to retrieve music files and playlists from your iPod. I use Senuti but have a look at the web pages and documentation for the others too, you'll find that they have varying degrees of functionality and some will transfer movies, videos, photos and games as well. This is just a small selection of what's available, you can read reviews and comparisons of some of them here:
Senuti Mac Only (Currently only the beta version is iPod Touch & iPhone compatible)
PodView Mac Only
PodWorks Mac Only
iPodDisk PPC Mac Only (experimental version available for Intel Macs)
TuneAid Mac only (iPhone and iPod Touch compatible)
iPodRip Mac & Windows
YamiPod Mac & Windows
Music Rescue Mac & Windows
iPod Music Liberator Mac & Windows
iGadget Mac & Windows (iPhone and iPod Touch compatible)
Floola Mac & Windows
iRepo Mac & Windows (iPhone and iPod Touch compatible)
iPod Access Mac & Windows (iPhone and iPod Touch compatible)
TouchCopy Mac & Windows (iPhone and iPod Touch compatible)
There's also a manual method of copying songs from your iPod to a Mac or PC. The procedure is a bit involved and won't recover playlists but if you're interested it's available on page 2 at this link: Copying Content from your iPod to your Computer - The Definitive Guide
Keep your iPod in manual mode until you have reloaded your iTunes and you are happy with your playlists etc then it will be safe to return it auto-sync. I would also advise that you get yourself an external hard drive and back your stuff up, relying on an iPod as your sole backup is not a good idea and external drives are comparatively inexpensive these days, you can get loads of storage for a reasonable outlay.