Here's a simple write up:
http://www.heliconbooks.com/article/epubfootnote
But you dont need to use EPUB 3 markup. You can just make your link a superscript or subscript and the viewer will consider it a popup automatically.
For endnotes you can also use the following markup (no need to use superscripts/subscripts)
In the main text (text.html)
Code:
<a href="somefile.html#whatever" id="an_endnote">See this</a>
And make sure that somefile.html links back like this
Code:
<a href="text.html#an_endnote">back to main text</a>
The viewer will automatically consider this pair of links to be an endnote. The hrefs, ids and link text in the above can be anything. The important thing is to have a link going to a another file, and that other file must link back to the original file.