JVManager does all that. It's not cheap, but you can buy the full script or for much less money a hosted account from someone who offers them. It's really huge and you can use it to not only manage memberships separately but also have all your products in one affiliate program. It offers 'traditional' memberships with htpassword protected folders as well as minisite memberships with nice login pages and auto generated, template based content and affiliate pages.
I hope that doesn't sound too promotional, but I'm a huge fan. :-)
I compared roundabout 40 scripts and ended up with JVManager.
If you have any specific questions about it just ask.