What I believe to be the uses of each class:
Scout - get in, get out, fast.
Soldier - Attack and push the enemy back, aim for the big guys.
Pyro - Spycheck and push the enemy back, ambush groups of peple, take health down for other players to finish off.
Engineer - Annoy the **** out of Scouts (and defend whatever)
Demoman - Blow shit up, but just because he likes to, defend bases and engineer buildings with stickies.
Heavy - Oppress the enemy, make them retreat, lead the group forwards.
Sniper - Kill the other snipers, and occasionally bodyshoot the other classes.
Spy - Annoy the **** out of heavies, soldiers, engies, snipers, and medics, and destroy sentries and dispensers.
Medic - Makes you feel good and powerful until he dies/leaves you, provide the team with confidence of backup health.
That's how I've always thought of it. I think valve really put thought into each class.