If it's something like Blissey, I'd max its HP and sp.def.
For Dusknoir, I'll max out its defense and sp.defense,
In other word, it depends on Pokemon, but I'll max out HP first if it has equal HP and defense(Mew, Celebi, Jirachi, etc.).
Meh, if it's Blissey then you should max out its defence at least, Its sp-defence is already good enough. Then max out the rest of the other remaining EV's on HP or some on sp-defence too, depends.
Wrong. ._. With maxed out HP and Defense Blissey was able to survive two max power Hidden Power [FLYING]s from Salamence, but without any Defense at all, Salamence can easily OHKO it, and I reckon it'll be able to take at least one hit from a Life Orb Salamence in D/P if it has alot of Defense and HP EVs and Counter it right back at it. There's a reason for why competitive battlers give Blissey full Defense EVs.Eh, if you slap 252 EVs in Chansey's defense, it's still gonna get slaughtered by one physical move. :/