In short:
Scouts:
- Pick up money. They have a huge pickup radius. No money means no upgrades and you can't win without those.
- PICK UP THE MONEY
- Eliminate pesky snipers, spies, etc. in hard to reach areas.
- Throw milk to slow groups (with upgrades).
- Use the fan of war or upgraded sandman to mark giants.
Soldier
- Damage waves of enemies and attack the tank. Kritz is useful here.
- Can rocket jump to move quickly and reach pesky enemies (snipers, spies, scouts with the bomb).
- Buff Banner to give everyone mini-crits.
Pyro
- Damage waves of enemies. Kritz is very useful here.
- Attack the tank with the Phlog. Ammo refills are very useful here
- Specifically ignite enemies and run away, letting afterburn do a lot of damage to enemies (especially fast scouts).
- Airblast the bomb carrier and juggle ubers. Airblasts can buy more time if the bomb carrier is on the hatch. It can also blow the bomb carrier off of bridges or into holes, either delaying the bomb or forcing a reset.
- Generally as front line attacker, they can also pick up money.
- Spy checks.
Demoman
- Set sticky traps. Combine this with a before round kritz to lay effective traps for tank, groups of medics, giants, etc. You'll use your sticky launcher more than your pipe launcher generally.
- Damage waves of enemies and attack the tank. Kritz is very useful here
- Sticky jump to move around and clear out snipers, spies, bomb carriers, etc.
Heavy
- Your main attacker. The heavy shoots down waves of enemies and damages the tank and giants. Give him kritz and ammo.
- Give your sandvich to a teammate.
Engineer
- Set up Sentry Guns. Sentries, like the heavy, are your main damage dealing to enemies. Keep it alive. Watch for sentry busters!
- Set up Dispensers. Generally left by the Heavy and the Engineer picks up their own metal. It also heals hurt teammates near the front lines.
- Set up Teleporters. After death, teleporters save valuable time that would be wasted walking.
Medic
- Heal and keeps the team alive. Duh..
- Kritz/Uber (from medigun or shared canteens upgrade) to mow down the enemy. Kritz the heavy or pyro for tanks. Kritz a demo before the round to lay crit sticky traps.
Sniper
- Headshot giants for extra damage. Combine with explosive headshots to clear groups of robots.
- Throw Jarate to give more damage to giants or waves of enemies. Will slow if the upgrade is chosen for it.
- Sydney Sleeper gives jarate effect to giants and other enemies.
- Counter snipe other snipers.
Spy
- Sap waves of enemies. The sap also reduces giant's armor and speed. This is very important for waves with giants and uber medics.
- Stab groups of enemies, especially sapped ones or medics.
- With upgrades, stab giants for high damage.
- Pick up money. As a front line attacker with a disguise the spy can easily pick up money.
- Go after pesky snipers.
A general setup is an engineer, 2 heavy's, soldier/demo, scout and pyro. This is flexible but the most common and successful setup I've seen. Generally Snipers aren't favored. Map selection and current wave lineup can favor or handicap other classes like pyro, spy, sniper, etc.
This is all from my general experience in playing. There is more I'm sure I'm missing which I'll add later. Keep in mind everyone plays the classes a little different: Some scouts like to use Bonk, some soldiers like to use the concherer, etc.