I run two games for two sets of players, so there's an NPC traveling with each of them. In both parties he's an upfront fighter-type, mostly there to round the party out. He's built on the same stats as they are, so it's balanced. However, I fudge rolls. Just like one poster said, if a major enemy is low on health, the NPC will take that round to heal a struggling party member or grapple him to hold him for the big guns.
I've had other NPCs involved in battles, but they're usually off in the distance. If an extra one is in the party, they're good enough to be competent, but really not stealing the show. I tend to be a bit more tactical with them -- capitalizing on PC manuevers, or setting up PC manuevers. Grappling, tripping, disarming, or finding a way to buff the party. That way they're still helping and aren't looked upon as dead weight, but don't take the spotlight away.
I'm starting to have NPCs work to help the PCs in other ways. They fought alongside a blacksmith/pilot before, and now he's behind the scenes, working on their ship and upgrading their weapons. Keeps him familiar, and also off the front lines.
The NPCs really don't have to be in combat -- and if they are, it's very possible, and logical to say, "Lord Revilgaz emerges from the shadows to confront your entire group. 'Do you truly believe that your pitiful band of imitation heroes has any chance against my elite lieutenants and my well-trained men?' Beside you, Norin the Good-Hearted says under his breath, 'I will get his men out of your way. Don't worry about me -- just get Revilgaz. I'll join you if I can.'" And then you roll a couple dice to see how their battle goes, while the PCs, the real heroes, beat the tar out of Revilgaz.
I used to use NPCs too much -- small party syndrome. I still use a few to keep heat off the spellcaster, but they're still support for the heroes.