ePub uses XHTML and CSS for markup and styling. You can provide Calibre with extra CSS styles in the conversion options, and if that's not enough or your books still aren't coming out well-formatted you can use a tool like
Sigil to edit them and clean them up to your liking.