If you only want to copy your purchases to the computer that can be done using iTunes, you'll find details in this article:
Copying iTunes Store purchases from your iPod or iPhone to a computer
For everything else (including purchases) there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod Touch or iPhone. You'll find that they have varying degrees of functionality and some will transfer data (such as playcounts and ratings), movies, videos, photos, podcasts and games as well.
A selection of iPod/iPhone to iTunes utilities:
Senuti Mac Only (iPod Touch & iPhone compatible)
SharePod Windows Only (iPhone and iPod Touch compatible)
TuneJack Windows Only (iPhone and iPod Touch compatible)
Music Rescue Mac & Windows (iPhone and iPod Touch compatible)
iGadget Mac & Windows (iPhone and iPod Touch compatible)
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)