If you want Bayonets, you can have bayonets.

Here's where D&D 5e is actually a big help, because of the way combat works, "Just shoot them" isn't always an option, since once an enemy is in melee with you, you get disadvantage on ranged attacks.

This wouldn't quite translate, since a modernish firearm, unlike a bow or crossbow, can shoot fast and easily enough that an enemy in melee isn't necessarily going to be able to spoil your aim, but you can ignore that and keep the "Firing while in melee" rule, in which case being able to seamlessly switch between melee and ranged attacks is going to be useful, especially with teleporting demons. You won't be seeing bayonet charges, so much as Bayonets used when soldiers find themselves thrust into melee.


Another option is to play around with damage reduction. Bullets are good at killing things, but if the demons, say, are resistant to damage that isn't made with silvered weapons, you hit a cost problem.

Equipping an army with silver bullets is going to be outrageously expensive. Maybe sharpshooters or elites can afford to spray silver wildly, but not grunt infantry. However, silver-tipped bayonets would be far cheaper (Ignore the PHB rule that puts 100GP on every silver weapon)