If using a ranged weapon, firearm, or standard game weapons, add your Dex bonus to whatever the weapons attack damage is. The attack always has that applied as well. For traditional weapons, if you are proficient with it, you add your bonus. To even out the higher damage output of firearms you only add that bonus if you use a bonus action to aim.