There's a bunch of info missing, so this will be fairly speculative. I'm thinking that maybe you've got one of those aluminum bodies, and the sprockets have eventually carved their way through the splines enabling them to rotate along with the chain w/o engaging the wheel. At minimum you're looking at a new body ($25-$50 for average stuff, $80-$100 for specials)
The sensible thing would probably be to replace cassette, chain and body, which will set you back a bit more, depending on what level of kit you want to put on there. Another $70-$100 should be able to see you through.
If it was only the smallest gear there's a small possibility that improper assembly would cause this effect, but I don't really believe that. If this would be the case, then maybe you could get away with a new and properly mounted cassette only.