For the edition of D&D I play (5.0), I don't distinguish between monsters and NPCs. I have "encounters". Whether the encountered creature(s) will attack or talk first depends on a few factors:
If their Int <5 and they aren't surprised, they attack.
If their Int =5 or greater and the party is...