The roll and the appropriate modifier are added together to get total damage.
When attacking with a weapon, you add your ability modifier-the same modifier used for the attack roll-to the damage.
Let's say for example, a level 1 rogue with a +1 DEX mod attacks with a dagger(1d4) which does piercing damage. He would add the 1d4 + 1, but he also has Sneak Attack.
If a class feature increases the damage of an attack but doesn't specify a damage type, it is included in the total damage of the attack.
So, total piercing damage would come out to be 1d4 + 1(DEX) + 1d6(Sneak Attack) and if a creature had resistance/vulnerability to piercing damage that total would be halved/doubled respectively.
But if a class feature does specify a different damage type, you split the damage types and apply resistance/vulnerability separately.
Let's say we have a paladin with a +1 STR using a flail(1d8) with Improved Divine Smite(1d8).
Total bludgeoning damage would come out to 1d8 + 1(STR).
Total radiant damage would come out to 1d8.
If the target has resistance/vulnerability to either damage type, the damage of that type is halved/doubled independently of the other.