@YetiMooseDoes a dagger count as both a melee and a ranged weapon for feats? In other words can I use the sharpshooter feat with a dagger? yes – it might feel unintuitive for the bonus damage, but it doesn’t break anything
— Mike Mearls (@mikemearls) September 17, 2014
For those who arrive here via search engine, this ruling was later superseded by another clarification.
Tl;dr a dagger remains a Melee Weapon even when you make a ranged attack with it, and a ranged attack remains a Ranged Weapon Attack even when you make it with a melee weapon. So a thrown dagger counts as a melee weapon for features that affect “attacks with a melee weapon” and as a ranged attack for features that affect “ranged weapon attacks”.