Both versions are perfectly grammatical and natural-sounding, but they mean slightly different things. Sort of. If you want them to.
That sofa needs cleaning again.
This means that some attempt needs to be made towards cleaning the sofa. Unless it's your mother saying this to you, the implied end result is not necessarily a perfectly clean sofa. (If it is your mother, then you're usually better off assuming she wants perfect cleanliness, even if all she says is "Hmm, that sofa has been cleaner." But I digress.)
That sofa needs to be cleaned again.
Here, there is at least a slight implication that the desired end result is a clean sofa, not just a cleaner sofa.
Now, keep in mind that these are just-barely-discernible shades of meaning, not outright "use this if and only if you mean..." In practice, the intended meaning is almost always total cleanliness or a reasonable facsimile thereof.
Regarding 2a and 2b, both are possible1, but neither is what I'd say in that situation. Better alternatives:
You need to get your head examined.
You need to have your head examined.
Your head needs to be examined.
1 The version without the "to be" starts to sound a bit like the Central Pennsylvania dialect "that car needs washed" type of construction; it sounds awkward, but not necessarily wrong. But then, I live near Philadelphia, so perhaps I'm not the best judge.