How to make shortcode which returns HTML?

You can check this out – wpgallery plugin, this is how they do it for the shortcode, basically parsing the shortcodes on the client-side, and replacing them back and forth as you click “Visual” or “Text”.

Unless you are building a plugin, I would advise you to refrain from using shortcodes – use plain HTML, you’ll have an easier time working with the DOM, and the article contents will be more or less portable across themes.