Consistency. Punish the bad behaviour, reward the good behaviour. That second part is important else they're going to feel rejected. Strong boundaries. Never give them an inch because they'll take a mile.
Think before you answer, "I'll get back to you about that" is an acceptable answer to buy you some time. If they need an instant answer and you're not sure, then it's a no.
You can always change your mind later and say yes, whereas cancelling after you've said yes isn't always an option. Don't do this in the early days of establishing your boundaries though, it's too confusing for the person who's learning, keep things crystal clear to start with. Regardless, never at any time back down in the face of pressure, for the sake of an easy life, if you've said no. Any sign of pressure and you revert to "piss off".
So "piss off etc" every single time they try that shit. Then when they're behaving like a reasonable person and giving you some space, invite them to spend time with you. Or accept their polite invitation if it's been a reasonable timescale since they've last asked.
Manage their expectations to avoid disappointment.
Eg "would you like to come for Sunday dinner 12.30-3pm? We'll aim to serve the food at 1pm and we're going to spend the late afternoon with friends/pottering in the garden/having rampant sex etc, we'd love to have you there for dinner though.
Eg "would you like to come on holiday with us for a week? We'll be spending mornings by the pool, afternoons on the beach and evenings in the bar. We thought it would be nice to go on a couple of day trips whilst there if you'd be up for that? I'm sure there's plenty in the local area to do solo if you get bored hanging around with us".
You can negotiate details if you want to, they might have some good ideas. If you don't like their ideas or you've already compromised by inviting them in the first place when you'd much rather go alone, then just say no to anything more than you've offered.
If they're misguided or socially inept but capable of learning, it should work.
If they're an arsehole they'll just increase the control freakery further to attempt to cow you down, arguements will escalate, they'll be convinced you're the problem (how dare you attempt to change and not take their shit any more!) and the relationship will break down completely. But at least you'll now both know you don't like each other and you won't be having to put up with their behaviour.