Optimal setup would be 1 Rogue, 1 archer, 1 2h melee or second archer, and 1 caster (pyro/geo/poly).
Even on non casters you want to get some utility/buff spells like peace of mind because it protects against debuffs and boosts your Wits(crit/initiative) and your main damage dealer stats, Nether swap and TP for rogue can also let you backstab enemies that are otherwise in a bad position, even lets you perform AoE backstabs (Crippling Blow, Whirlwind).
Rogues are best sent after squishy casters , they can easily cc low magic armor enemies too with Chloroform tho. Rogues have access to a lot of debuffs and CC that can render enemies unable to act, they also posses good mobility.
Archers are, as stated by others the strongest class when we don’t count Necromancer, who just outright destroys everything and makes combat trivial.
The problem with magic damage dealing casters is resistances. For some reason, the only good debuff spell that reuces resistances and removes some magic armor comes late in the game and scales from Strength (it’s a polymorph spell called Flay Skin), and because of that you can and will often face enemies who’ll boast 40-70% damage resistance (some enemies can even heal from specific damage types) to the element you’re specialized in, leaving you at a serious disadvantage.
2h, 1h (with shield) and 2x1h melee weapon builds work too, they will deal less damage early on but will catch up later pretty quick.