I say this as something who doesn't normally use the product, but Adobe InDesign allows for an easy export into PDF and epub. I don't know about formatting code blocks though. Adobe ID has a monthly subscription, so even though it's a premium product, in many cases you're only using it for one or two months. You might be able to buy some low cost Adobe ID templates, so you don't have to set everything up.
I use a Docbook solution (with Docbook XSLT, using the Oxygen XML editor software). This produces output very easily in html, epub and pdf, although the learning curve is high. (Also, Oxygen XML license is pricey for commercial use). Docbook can do code blocks very easily; on the other hand, when producing pdfs, you have limited formatting options. Oxygen uses the open source Apache FOP (which lets you output from Docbook XML to PDF), but there are commercial options (in the 200-500 range) which let you produce nice looking PDF files. (Check out renderx and antenna house). Docbook can do output for webhelp, javahelp, htmlhelp as well. Docbook works well, but the toolchain is hard to set up.
A "dumb but effective" solution might be to code your output in HTML, paste it into MS word (to produce a PDF), and then to use SIGIL to move the html files into epub. Or use the MS word file as the source for doing output using Calibre.
There are pros and cons for each solution. I haven't used pandoc, but it sounds like a good solution if you have lots of legacy latex content.