You can't have it both ways, though. If the dagger becomes a ranged weapon when you throw it, then you're not making an attack with a melee weapon, and the dual wielding rules don't apply.It does, however depend on your DM's interpretation. If you allow any attack with a thrown weapon to be considered "an attack with a ranged weapon" then sharpshooter works, but if you interpret it that throwing a dagger is a ranged weapon attack with a melee weapon (which is what the rules suggest), then it wouldn't.