EPUBGen is a project that Peter Sorotokin has started, it’s a conversion utility for rtf files, word files, and FictionBook files. The output in each case is, of course, epub.
The project is open source, and available for download.
Note that there is also a .jar file for rtf2epub and it should work, but the main intent of this project is to provide source code and examples of the way things could be done. In other words, there’s plenty of room for developers to improve and enhance the conversion.
The project includes code to convert a couple different formats to ePub, including generating all the required files and creating the package. The project also shows how to mangle embedded fonts, how to sub-set those font (thus reducing the size of the ePub).