Also look at it this way, dwarves invented tanks, guns, cannons and gunpowder in general yet even they prefer to stock most of their warrior in heavy dwarven steal swinging hammers and axes, why? Because while guns may have their uses and are effective if used right, on the larger scale of things, melee is better :P
It's not that it's better. Armies in Warcraft use siege weaponry and artillery, but in an equivalent time (say the American civil war), though there were guns, ultimately battles were won in close quarters. I would imagine that it's a similar issue in Warcraft. No army really has the resources to keep fighting from a distance, and since other armies can't either, then it would be foolish to do so.
Even today, soldiers are being trained on how to deal with CQC situations. Why? Because it still happens. Even when you can blow a guy's head off from half a mile away with an assault rifle, you still get into situations where you need to kill someone up close, where guns are ineffective.
Swordsmen, lancers and whatnot didn't get taken out of armies (IRL) as soon as the first musket popped up, you know. I'm no history major but I think there were a lot of close-quarter combat going around until the advent of rifling. Muskets and early rifles were so slow to reload that it was feasible to charge a line, take acceptable losses, and still be there in time and with numbers to overcome the enemy position. I'd say that, in those days, muskets were a good replacement for crossbows but still not powerful enough to take swords out (look at the classic french musketeer, for example, they had a musket AND a sword).
Musket's were really only used to try and give their team an advantage over the others and try and dwindle their numbers before they got into hand to hand combat. Besides... muskets and other firearms alike were so unreliable and inaccurate you would of been better off throwing the damned thing at the person you're trying to kill! lol