There are two known types of people: Multipliers and Dividers.
Multipliers are people who boost you and make you feel better about yourself/situations etc and they're basically happy people who know who they are and feel happy in their skin.
Dividers are people who feel the need to balance your emotional state. Imagine a graph, if you're totally at the bottom, they'll say something nice, maybe two nice things, which bring you back to the middle, if you're happy, they'll say things that hurt, or they'll make their problems your problems. Thereby bringing you back down to the middle. They're not happy with themselves, their situation or their mental attitude and this makes them a pain in the ass to hang around with.
The key is to remember, a leopard never changes it's spots, unless the leopard went through rehab or had help, he isn't ever going to stop bitching (that analogy got out of hand =/ )
Bottom Line: Live your life, not theirs. Don't take their problems as yours. "Ah, I've got this huge assignment and the college doesn't allow this, or cater for that, and my teacher is a bitch" .... "shame, you got it hard, so what we doing today?" - keep steering the convo in directions you want it to go in or drop the person!

Hope this helps!