I'm planning to start working on an html2epub converter for calibre in a couple of weeks. I've outlined some of my ideas for it at http://calibre.kovidgoyal.net/wiki/HTMLEPUBConverter
If you have some suggestions/ideas/feedback/wishes chime in, either here or on the wiki, and I'll try to acommodate them as I go along.
As background, calibre currently uses the html2lrf converter as the backend for conversion of all formats to LRF. html2epub will play a similar role for EPUB. As such it will be the cornerstone of EPUB support in calibre and thus requires careful design, so that maturing it wont take as long as html2lrf took.
The initial design goal of html2epub will be to serve as a backend for web2epub and feeds2epub. Next will be lit2epub, mobi2epub, txt2epub and so on. Finally EPUB as an output format will be added to the GUI.