In my own experience, firearms cause a lot fewer (perhaps none at all) friendly fire deaths. I think it's much safer with firearms to have them firing over top of other units, which is counter-intuitive. (The only thing I'm not sure of is if there's a damage penalty for this, but it seems effective in my experience.)

This means that you can deploy with spears/pikes/heavy inf in front of your gunners. It also means you can deploy gunners behind other gunners with good effect.

Generally though, you have to deploy firearms units in lines of two or the reloading can get screwed up.

Also, the better musketeers, such as Russian Cossak Muskets and Turkish Jannissary Muskets can even hold their own in a cavalry charge, definitely long enough to bring in support cav from the flanks or rear. You'll take losses in this case but the units won't rout instantly when charged like many missle units.

Having said all that, I find that a setup like this can destroy most armies, even holding it's own against Timurids:

LHH--IFFFI--HHL
---GFF-I-FFG---
------AA-------

L = light or missle cav
H = heavy cav
I = Heavy inf/spears/pikes
F = firearms
A = artillery, ideally with range advantage
G = General's Bodyguard

Of course, this setup relies on engaging the enemy from a distance. It's cavalry heavy which becomes useful in destroying other enemy cavalry or missles that separate from the enemy's main lines. If the enemy decides to stay grouped and wait for your attack, it can be very effective to pull the left or right firearm "linebackers" out to one of the enemy flanks to provide enfilade fire.

Your own mileage may vary. There are some situations where this setup will not be effective, however, such as attacking uphill through a forest, or assaulting walls.