If you want to find out how to create an ePub by writing the code and compiling it yourself, here are a couple of useful references. The eBook Design and Development Guide, by Paul Salvette. Available on Kindle.
Also, the related website, BB ebooks.
Build a digital book with EPUB, by IBM.
And a wonderful tool, the ePub checker, from Pagina online.
Warning - it's a painful process and takes time. If you don't want to write code, this isn't for you! However, if you are comfortable with html and css, I recommend learning how to do it yourself. Once you have repeated the steps a few times and worked out your own templates and processes, you'll be rewarded with messages like these: