I have the most hours played as spy and medic but I usually play whatever class is needed at the time or whatever I feel like playing. Today for example I was in the mood to play huntsman sniper.
i usually play pyro and spy but will also play as heavy or medic if needed. and also if im playing capture the flag and literally no one else is one ill play engineer. i don't know how people can play as them ._.
I play either the Pyro (backburner is awesome), medic or soldier. Sometimes the demoman too. Depends on the team's makeup though. I've logged most of my TF2 time on the medic though, most teams I've been on have too few medics so I balance it out.
I tend to play Engineer, Spy, and Medic. But sometimes I wil, wander off and play as a Sniper, Soldier, or Heavy if they're needed.
My favorites by far are Medic & Sniper. On a side note: The one who masters spy, can and will cripple the enemy team and put them down on their knees.
I find that Demomen suck with the exception of taking out sentries, heavies, and people in narrow corridors. Anything open and they get the shit blown out of them, usually by soldiers and heavies.