I generally have them work mechanically like any other ranged projectile weapon -- crossbows or bows or atlatls or whatever. Ranged attack roll vs. AC for a damage within the normal range of damage for a ranged weapon (usually on the high end, with a lower attack bonus, giving ranged attackers the "Greatsword vs. Longsword" debate when choosing between guns and bows). Simple is best.
This gives them a niche, without making them predominant, because I still want a place for elves who twang bows regularly in my games. I just also want a slot for gunslingers and steampunk fantasy.
Depending on the melieu and archetypes I want dominating my setting, I might opt for more, less, or more complex rules.
For a more "realistic" take on a big loud violent kind of weapon I might do this:
- You can fire your gun every other round. It takes a standard action to load it. If a power gives you a multiattack, you can only fire your gun for one of the attacks, and you'll have to have another weapon in hand or loose the other (this would be the advantage of pistols over shotguns perhaps).
- Guns deal about double the damage that bows deal. 2d10. Maybe 2d8 for a pistol. Over a given combat, it'll kind of even out, but guns will "spike" harder.
- Guns attack Reflex and don't give you a Proficiency bonus. This simultaneously models "penetrating power" (it's not vs. AC! Armor is nigh useless!), and low accuracy (no bonus for being trained in them...), while being balanced (lower attack rolls vs. the lower Reflex defenses).
- Guns are expensive, loud, and hilariously un-subtle. They require a feat, a lot of gold (even to re-load), and don't mesh with Stealth. This has the potential of ratcheting them up to "too expensive" for most characters, though. Still, they were "too expensive" for most people historically, so that makes sense.