Played with in Exalted. There's a magical gunpowder equivalent which is used in guns... But there's no projectile. The "guns" just shoot a stream of fire like a miniature flamethrower. The in-canon explanation is that the guns originated during the Primordial War, when the tech-advancement of the Solars would've gone from crossbows to lasers in only a few years.
And let's not forget the BFG of the setting, a shoulder-mounted version that can fire molten-hot pearls covered in magical napalm.
Actual standard projectile handguns were introduced recently in the form of "prayer pieces." In typical Exalted fashion, they are made of gold and fire golden bullets that are propelled by the faith generated from miniature shrines engraved on the barrel.
A rather clear case of Guns Are Worthless, too. Whatever assorted "firearms" of the setting can do, arrows can do just as good or better, especially considering there are arrow-tips with almost every projectile type avialable for guns. And in the hands of one of the namesake Exalted, soon enough a toothbrush and a nuclear bomb become equally deadly.
Aversion: The furry Tabletop Game Ironclaw, which features a Renaissance-era technology level, features guns. They're portrayed with all the limitations guns of that era had: they have a chance to misfire, they're expensive, they have a very long reload time, they can't work well in rain, etc. On the other hand they do twice the damage that other weapons in the system do.
Averted in Warhammer: The Empire and the Dwarfs (especially the Dwarfs) make extensive use of handguns, pistols, cannons, mortars, volley guns, and recently, rockets. Oh, and steam-powered tanks and helicopters. Let's not forget the Skaven, who wield sniper rifles, flamethrowers, GatlingRatling guns, laser cannons and... a nuke. A lot of which hilariously backfires. However the Knights of Bretonnia have Fantasy Gun Control in their own kingdom. The whole nobility = lancing people down in 5th edition, in 6th seems to just be pique. In fact, they have Fantasy Gun Control in Bretonnia so hard some knights have magical protection from guns just because they hate them so much.
In Warhammer Fantasy Role Play, rules are provided for gunpowder weapons but their use is discouraged by all the limitations put on them - they are extremely rare, extremely expensive both to purchase and to maintain, they are prone to misfires (capable of actually killing the wielder, with a bad roll) and they don't do any more damage than the cheaper and more reliable bow and arrow.
Amusingly, the Bretonnian supplement for Warhammer Fantasy Role Play gave us a look at the statute decreeing Fantasy Gun Control. A strict reading doesn't support a ban on firearms. It bans crossbows, but it hadn't been updated since the introduction of black powder weaponry, although such a ban would be within the spirit of the law. There is, in fact, a movement in the port city of L'Anguille laying the groundwork for a call for either a stricter reading, or explicit amendment of the law, so they can openly upgrade the harbour defences with cannon.
The Mage Knight miniatures game had a whole faction of gun-toting Dwarves & Humans, specifically as a counter to the setting's technomages. They had everything from flintlocks and arquebus to chain guns and personal cannons.
Averted in Iron Kingdoms the setting makes use of guns for nearly every faction in the Warmachine game.
A very straightforward practical application of this trope, invoked by the publisher. Some time ago Magic used to have power armors and laser-armed spaceships on top of everything abovesaid (which if you check up editions is rather old, too). Nowadays, however, they announced they'd like to keep game's flavor a lot more "fantasy'sh", therefore firearms are remarkably absent from all the recent Magic sets.
This became one of the founding pillars of the style of Scars of Mirrodin, where combining with the Machine-ideology of Phyrexia on a wholly metallic plane obviously had the implication that high-tech robots would be running amok, the designers specifically said that while things like armor, gears, levers and pistons can appear, they are to be used so that they are in no way mechanically sound, and must appear as though they're being powered by magic. The result is that most of the inhabitants had high-tech apparatuses used solely to swing around giant blades, and very little way of guns appear.
In Dungeons & Dragons itself the 3rd edition Dungeon Master's Guide provides rules for certain "Renaissance" gunpowder weapons, modern and even futuristic firearms and explosives if they are to be included in the setting. Normally they are highly expensive or not buyable at all, however. AD&D 2nd edition had the arquebus (an early European musket) available for players to use at the DM's discretion. The 1st edition Dungeon Master's Guide included in-game statistics for firearms, Gatling guns, dynamite, and other Wild West-era weapons in the context of a crossover campaign with Boot Hill (a now out-of-print Old West-themed RPG sold by TSR at the time), but it was "strongly urged" that they be limited to specific adventures or areas.
The Forgotten Realms explicitly states that gunpowder does not work due to the divine will of Gond, god of invention and creativity. Instead, Gond allows an alchemical substitute called "smokepowder" to exist in the hands of his church, so that its use is easily controlled. There's also a Thayan variant — very clumsy bombards using some liquid propellant, not scalable down to portable guns. Also, pneumatic needle guns were mentioned as a typical trick of drow commoners (The Drow of the Underdark): it's easier to conceal than a crossbow. Ed Greenwood even wrote a few articles on this issue (the first being named "Firearms: First guns were not much fun") for Dragon Magazine.
R.A. Salvatore sometimes mentioned guns and other non-magical explosives in his The Legend of Drizzt and other Realms novels, sometimes having the protagonists comment that they're too dangerous, and at other times having protagonists treat them as being useful in the right situations:
When Cadderly, the central character of Salvatore's Cleric Quintet, invented a crossbow with an exploding bolt (created using the magical substance, oil of impact), he eventually ended up horrified of it. When a villain ended up with it, he became wracked with guilt and was almost convinced it must be destroyed for the good of the world. Particularly jarring as another character points out that said villain is a wizard capable of shooting explosive fireballs from his hands, and that Cadderly's crossbow was terribly weak in comparison. However, he uses it again in The Ghost King, which takes place several years later, against shadowy monsters invading Spirit Soaring, without showing any reservations about it. And later, Jarlaxle, a drow mercenary, gives him the idea to create a much larger explosive bolt using a hollowed out log filled with an explosive substance in order to help them fight an undead dragon.
In The Thousand Orcs, Nanfoodle, a gnome alchemist (and follower of Gond) engineered an explosion that proved to be useful against invading frost giants, and, in a later book, it was said to be more powerful than any fireball that even Elminster could have conjured up.
In The Stowaway, a novel that he contributed to along with his son, Geno Salvatore, the protagonist notices an arquebus mounted on a wall in the captain's cabin on a ship that he'd just boarded. Later, during a raid the ship, a couple of pirates enter the cabin, grab a hold of the gun, load it with smokepowder, and play around with it (with one pirate taking aim at the other and pulling the trigger), causing a blast that they both manage to survive.
In this universe, smokepowder is just as dangerous to the user as to the target. "One in ten" is a common saying, meaning that one out of every ten uses of a smokepowder gun will end up blowing up on the user.
In Waterdeep smokepowder is illegal, and Khelben (Waterdeep's highest-level wizard, and a member of the city's ruling oligarchy) eliminates every pinch he can find, along with those who smuggled it in.
A couple of anthology stories touch on the subject of smokepowder, both of them making the point that smuggling smokepowder can be more trouble than it's worth. In Smoke Powder And Mirrors by Jeff Grubb, Khelben himself stands next to exploding barrels of smokepowder and isn't even singed or disheveled. In another Waterdhavian story, one of the contraband-hunting characters receives a point-blank blunderbuss shot in the face. He recovers from its flash and thunder in as much time as it takes to say "Protection from Normal Missiles".
Side note: All of the above are true of gunpowder as well. The balance is that firearms, while not any better than a crossbow in any practical sense until the US Civil war, are extremely easy to load and operate, making them great for empowering the lower classes but not so great for the hereditary monarchies of medieval Europe to maintain their monopoly on military force. So, depending on how much credit you want to give the author, this may be a clever way of slipping some in-setting Values Dissonance into the story, making the characters true believers in the quasi-feudal system that keeps the peasants at the bottom where richer and better-supplied people like the protagonists and their foes can easily run over them without repercussion.
Eberron plays this trope straight. Their justification is that a wand of magic missile or an enchanted crossbow is so common (and far safer and effective in the hands of a conscript) that no one ever really bothered to make guns.
Spelljammer has Giff — a race of mercenary-mindedhumanoid hippopotami. They love firearms, to the point of making the big cannon a structural element of a ship ("Great Bombard◊"), with its muzzle useable as a ram, and using smokepowder as a currency. Others usually avoid firearms, because fire is unusable in phlogiston, powder magazines are dangerous if hit and smokepowder isn't as cheap as catapult stones. Cloakmaster cycle shows both sides of the issue.
Given its roots in post-medieval Gothic horror, Ravenloft has never adhered to this trope. One of its earliest published adventures featured a blunderbuss-wielding NPC, and its 3E game products include rules for snaplock firearms, early gunpowder traps, and even a sharpshooting prestige class. That is, people can shoot them wolfies with silver bullets, yeah.
Subverted in the Dragonlance setting, where it's noted that some enterprising tinker gnomes have created their own versions of firearms. Most people don't use them, since tinker gnomes are notorious for their Bungling Inventor tendencies.
Greyhawk fans tend to be notoriously gun-phobic and it's generally accepted that guns simply don't work in the setting. Exceptions are sometimes made for the hero-god Murlynd and his paladins, depending on the DM.
In the Mystara campaign setting, this is played with in odd ways. The backstory of the campaign setting is that the pseudo-medieval setting actually takes place long after the collapse of the high-tech Blackmoor civilization, but every so often, high-tech items from Blackmoor or other sources will show up in a given adventure or campaign module. In the Hollow World campaign setting, which is really part of the Mystara setting, there is a valley containing high-tech elves, but their technology is really Magitek. Curiously, however, while you will never or hardly ever see firearms, you will see futuristic weapons like ray-guns and so forth. For rules purposes, these weapons will function like similar spells, such as magic missile, fireball, disintegrate, etc.
Averted in Pathfinder's official campaign setting. A magically-unstable region is home to blackpowder firearm technology, and maybe some early rifles, revolvers, and shotguns. Another region is a Conan the Barbarian-style land where an alien spaceship crashed. There you can find androids (available as player characters) and machinegun-toting Spider Tanks. Other planets in Golarion's solar system have even higher levels of technology, such as cybernetics and more spaceships.
The Ultimate Combat supplement for Pathfinder spends some time discussing various levels of Fantasy Gun Control, from 'there aren't even cannons around' to 'Showdown at the Orctown Corral', and noting how they can affect the tenor of the game.
Then the "Reign of Winter" Adventure Path added several WWI-era Russian guns (and a British tank). A later AP, "Iron Gods", takes place in the land with the crashed ship, and necessitated a brand-new sourcebook with technology up to laser weapons.
Averted in RuneQuest, to some extent — although most of the world has approximately Bronze Age technology, the Mostali (Dwarfs) have high-tech superweapons called "guns", which they guard jealously.
On the other hand this is partially played straight thanks to the dwarves, themselves, as they send Clockwork Creature gremlins to sabotage any human-made technology they deem too dangerous (not to mention automatically assume it has been stolen from them — and are admittedly right fairly often), ensuring that it will either work badly, or not at all.
In Legend of the Five Rings, using gunpowder is dishonorable and is illegal by Imperial law. Which, of course, doesn't stop ninjas from using smoke- and firebombs (which are dangerous to the user as well).
Averted in Swedish tabletop RPG Drakar & Demoner: the Chronopia module mentions large siege cannons made by the dwarves.
...but in previous editions of the game, it was specifically noted that using out of character knowlege of the correct proportions of charcoal, nitrate and sulphur would only produce a slow burning fire, as the laws of physics in the game world was different than on earth.
One issue of Dragon took the Greyhawk world a few centuries into the future and postulated jet fighters dogfighting dragons and a gunpowerless magiteck rifle: the rifle fired by teleporting the projectile close to the sun, allowing it an hour to accelerate due to the sun's gravity, then teleporting it back combined with a time-travel spell so it returned an instant after it left. Gunpowder-using guns were also mentionned as being an outdated technology, still in use by dwarves.
The GURPS setting of GURPS Banestorm has very literal Fantasy Gun Control, in the form of a conspiracy of wizards who keep the technology suppressed, both through flagrant destruction of stores of gunpowder whenever they're found, and by wiping the minds of anyone with the knowledge of making it.
The Fantasy Trip book "In The Labyrinth" includes descriptions of several types of primitive gunpowder weapons. Some of them can deal a lot of damage. However, gunpowder is expensive and unreliable, and guns are unwieldy in combat, meaning most characters stick with muscle-powered weapons (or magic).
Averted in 7th Sea, since its setting includes musketeers and pirates.
Partially averted in Lace and Steel, another tabletop game with a Three Musketeers-inspired setting. Guns exist and are common, but they are considerably slower than blades.
In Blue Rose, although setting is generally around the tech level of The Cavalier Years, there are no guns...but there are "crystons," which are basically just the Magitek equivalent of flintlock pistols (and are likely a subtle Shout-Out to the flashstones from the Dragaera books, mentioned under Literature).
The Swedish game Gondica has a Renaissance-esque technological level, and makes swords still important by