How can billing software not be tied to the gateway or merchant bank? I'm a little confused, since you need it to interface with whatever custom API you are working with.
It sounds like you're asking for ... gateway software that doesn't use a gateway?
www.pennywizepayments.com
or something like
http://www.mansionproductions.com/mpa2.html
If you need something custom I currently use custom signup forms and custom password management scripts, but it doesn't track billing or account, that's all done in the gateway's online admin.
C.