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 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's novels, particularly Drizzt series, only involved guns and explosives of the non-magical type (usually invented by priests of Gond, a god of creativity and knowledge) as a bad thing — too much power for too little effortnote A wizard could spend years in study to cast a fireball, went the logic — whereas someone with enough money could purchase a keg of gunpowder for roughly the same effect in less than a day. To the extent that when Cadderly, central character of Salvatore's Cleric Quintet, invented a crossbow with an exploding bolt, he was horrified himself. When a villain ended up with it, he became wracked with guilt and 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. It didn't shut him up, though.
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.
Stories in anthologies touching the subject only prove that in a high-magical world explosives are rarely worth the trouble and risk when a foe causes them to go off at the most inconvenient moment. In Smoke Powder And Mirrors by Jeff Grubb, Khelben himself stands next to exploding barrels of smokepowder and isn't even singed or disheveled. And a stupid wizard-slaying conspiracy would do just as "well" with drow-style poisoned quarrels to begin with. 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.
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 making muskets and similar weapons about as efficient as they were in reality. One review suggested PCs use bows instead, because for the kind of combats "adventurers" get into, guns are impractical.
Fantasy Craft averts this, and even has feats for Black Powder weapons. However, all items have an "era" that determine if items are available based on the Technology Level of the world and guns are only available in the Reason era or later.