Short answer: carefully.
You can raise the resistances of melee characters (armour bonuses, a talent available with Man At Arms maxed, etc), and get immunity to some status effects (such as stunned) from traits, spells or equipment. There are also teleport spells or the scoundrel skill Winged Feet to get over surfaces, and with appropriate positioning, it may be possible to either wait for melee opponents to approach, or use a teleport spell to put them next to a melee character.
Melee vs such opponents is generally ok, but some opponents can bleed fire or poison, etc, when hit (it will mostly go in the opposite direction of the melee character, but there can be some splashback if you are close enough).
Near the beginning of the game it would probably be safest to keep melee characters away from surfaces and AOE effects (though the Zombie talent would allow a character to heal from poison, at the cost of taking damage from normal healing).