Thanks a lot
Table of Contents if placed in InDesign is treated like any other story and is exported just like another text frame. This behavior is improved in InDesign CC and the TOC links are now intact in exported EPUB. All that is required is to check the option "Make text anchor in source paragraph" in Table of Contents dialog (this option was added in CC version) while creating TOC.
If you are looking for creating navigational TOC (one which is not placed in ID and is available in EPUB) in InDesign CS6, it can be created by selecting the TOC style from the TOC style dropdown available in EPUB Export Options dialog.
Please let me know if there are queries. I would be glad to assist you!