Example of using the ol.interaction.Draw interaction.
ol.interaction.Draw
See the draw-features.js source to see how this is done.