@sergio, Since I started with all this ebook stuff, I've found the need to learn a bit about both HTML/CSS and MSWord macros. The HTML/CSS was much easier to pick up. If you are expert in Word macros then learning HTML & CSS should be a walk in the park. Any time you spend learning HTML/CSS will not be wasted. The more you know the better your epubs will look.
Despite what others may say, with care you can get MSWord to produce excellent raw HTML. It's not so good (a.k.a. terrible) at creating great CSS but I find it best to strip out the generated CSS and insert a link to my own standard ebook CSS file.
To get started take a Word doc and SaveAs Webpage-filtered, then look at the HTML file in a good text editor (e.g. Notepad++). This should give you a good idea of how the styles you apply in Word translate to HTML tags and classes.
For instance, if you apply the MSWord built-in style 'HTML Preformatted' to a paragraph then the output HTML will contain that text wrapped in <pre>...</pre> tags. Style 'Normal(Web)' outputs <p>...</p> tags. There are a few 'magic' styles.
P.S. I admire your ambition at starting with a technical book full of code.

I started small with a Proj Gutenberg short story.