For example, if I use a magic dagger to stab a monster that is resistant or immune to piercing damage, but with no resistance or immunity to magic weapons, does it take full damage or not?
No, unless the Statblock says otherwise
In 5e, there is no such thing as Resistance to Magic Weapons or Attacks (not that I've seen in any statblock, anyway). There are creatures that have Magic Resistance, but that gives them Advantage on Saving Throws against spells and their effects (Note: this does not give them advantage against Spell Attacks, which are different).
There are a lot of creatures that have conditional immunity or resistance like this. For example, Werewolves have:
Damage Immunities Bludgeoning, Piercing, And Slashing Damage From Nonmagical Attacks or Weapons That Aren't Silvered
And the Chain Devil has:
Damage Resistance... Bludgeoning, Piercing, And Slashing From Nonmagical Attacks or Weapons That Aren't Silvered
These specifically state that their Immunities or Resistances do not affect Magical Attacks or Silvered Weapons. However, there are also creatures like the Ancient Red Dragon:
Damage Immunities Fire
Note that the Ancient Red Dragon doesn't specify that Magical Fire-based Attacks override it's immunity, so it is assumed that they don't.
Also, let's look back at the Chain Devil again, specifically at that bit I cut-out with the elipsis:
Damage Resistance Cold; Bludgeoning, Piercing, And Slashing From Nonmagical Attacks or Weapons That Aren't Silvered
That semicolon after the word "Cold" divides the two conditions, meaning that Cold damage from Magical Attacks or Silvered Weapons does not override the Chain Devil's Resistance to Cold, only the "Bludgeoning, Piercing, and Slashing damage" is overriden by Magical Attacks or Silvered Weapons.
In 5e, it is assumed that Resistance is effective against all forms of the damage being resisted, including Magical forms unless stated otherwise. This is in stark contrast to the RIFTS system where magical weapons or things like Magical Fire override immunity and resistance unless it specifically states otherwise.
That depends on whether the monster's stat block says so or not. For example, a lot of monsters with resistance or immunity to melee damage types will say "from nonmagical attacks". In this case, magical weapons do indeed bypass this resistance/immunity.
Swarms (i.e. Swarm of Insects), on the other hand, do not; they just say they have resistance to "bludgeoning, piecing and slashing". Another example is some of the oozes (Black Puddings and Ochre Jelly), which have immunity to "slashing". In these cases, a magic weapon would not help.