It's surprising that guns don't exist in D&D (or were never really covered beyond a few extra materials), considering the earliest ones in Europe date back to 14th century - during the middle ages (the rennaissance didn't begin until much later). Also, some of these early guns include organ guns - which were essentially awesome artillery that compensated innaccuracy for a whole load of shots.
And yeah, I think Leonardo Davinci had a sketch of an organ gun at one point.
Then again, D&D never did touch upon martial arts either (the monk was actually inspired by a novel called 'the destroyer', which at first glance, has got nothing to do with unarmed combat but involves chinese vampires and other things). And also, in taekwondo, we learn to punch at least at a rate of 4 times per second (a combat round is what, six seconds?); and I'm only a blue belt of 2 years (as opposed to the 'grew up in a monastery' backstory that belongs to most monks).
So I guess I shouldn't be too surprised.
Firearms for different purposes.
I think going for the middle ages look is still effective. Joan of Arc used cannon (yes, cannon) to destroy keeps and towers.
For innacurate weapons that are impossible to hit with at certain ranges (or at all) - it's possible to just up the caliber. This might be a favourite of stronger/tougher races such as dwarves, orcs and giants. For these, rolling the dice just determines the general square that the bullet will land in.
That said, this rule could effectively apply to any projectile that explodes or is big (already applicable for acid vials and alchemist's fire; but not the rocks that stone giants throw).
Warhammer does it very effectively in a single roll of dice - however one of the dice already indicates direction automatically and is only effective with a special random arrow generator code that myth-weavers does not support; 2d8 is usually a good way to rule (however it requires rolling each dice separately, to avoid confusing which results are which; this is quick in tabletop, but in myth-weavers, I suppose the first number that comes up could be direction and the next distance - and you must not gravitate away from this houserule, if you're using it that way!); and you could make the dice explode on high rolls to reflect the effects of a bouncing projectile that hits multiple targets. Explode means 'roll again' and then count the results with the original dice.
- Hand gonnes can be aimed, but it's very difficult (you could rule that it's impossible, unless the target is unaware and you're lucky, or the target is stupid and you have them in your sights at point blank for more than one or two rounds... or anything you like to make it a sometimes). Most of these weapons are pretty high caliber, so a direct hit is BIG DAMAGE, only it never happens (and I'd also throw out critical strikes for these weapons too; a catapult doesn't critical, so why should this kind of a gun? It isn't being wielded with the same mobility that a melee weapon or bow and arrow would; basically, just be careful as heck and hope to do damage). There's also the abus gun, and the culverin which dates from the 15th century (still middle ages!). Not to mention, full plate was invented in 14th century as well! So D&D crosses over to this time period, if only for rule of cool (knight in shining armor that covers every inch of his body).
- Rifles, mortars and rockets could all exist as a result of the meddlings of other, more advanced and hidden cultures that the PCs have to discover and explore. These cultures are greedy and secretive and refuse to trade with other races - either due to an unfortunate history of war, godly influence, etc.
Firearms and Armor
Firearms might give another reason to wear armor beyond the AC for a simple melee or aimed range attack (granted the attack is possible to aim). Maybe some confer impact damage and others cause shrapnel (grenade, or from a barrel)? Heavy armor might protect you from shrapnel, while softer armor (medium if heavy/soft, or light) could protect you from heat, or make a barrage of fire useless - since it lets you just dash out of the way.
Meanwhile, a helmet would make you less aware, but it's good in a chaotic battle situation where shrapnel is flying everywhere.
There's also noise and smoke - although smoke isn't as bad as noise. A smoke cloud can probably make an atmosphere get hot very quickly.
Smoke alerts a target to the general location of the shooter, but also provides the shooter with concealment. Granted, the shooter can't see out of their own smoke either! When you include magic, it's easy enough to do a gust of wind to blow away smoke so that it's out of the picture. However, smoke can also be very hot too - considering the lack of heat control in barrels that might have existed at the time.
Also consider that a barrel is probably useless after a few shots and needs to be gotten rid of. Even so, consider that the design of a hand gonne is rather simple, so a dedicated crafter can renew the supply fairly easily. Bullets are like sling bullets, but can become larger! The main trick is measuring out the explosive powder needed and then running for cover when the gun fires.
All said and done: A gun is only useful in taking on hordes of enemies (or stupid ones). When it comes to singular combat, it's going to be sword and shield once more and without fail.
A dedicated crafter can probably construct a stand and, with the use of a wick, get a handgonne to fire from a set location - this is just like timing a fireball spell to go off. It makes a good distraction, and a whole bunch of them can be hazardous for (ie.) the gang of bandits in the keep below.