Is it absolutely essential to take these sort of classes for your degre? I ask because the first, and probably easiest, way to avoid the sort of situation you're talking about is to avoid classes where these sort of assignments are expected. During my entire undergraduate career I can recall only one such project and even that was only minimally group-ish (just a bunch of people assigned to work at a certain site together). In graduate school I haven't even had to talk to a classmate much less work with one. I, personally, do like to interact with others because my field is kind of esoteric and it's easy to get stuck on a problem, but there's no reason I couldn't avoid all human contact if I wanted. I think most programs are basically like this.
If you absolutely have no choice, the way to go is to get your responsibilities established as quickly as possible, take care of them, and lay low otherwise. If you step up immediately and ask what the leader (someone always takes on this role) what she would like you to do there will be no complaints. Basically, you just have to beat them to the punch so there is no grumbling about free-riding, etc. Once you know what you need to do for the project just get it done and get whatever you've done back to the group ASAP. Let the others know they can contact by email if they need more info/help and hightail it out of there until your next meeting or presentation. You don't have to hang out with these people.