Is there a function that adds the media uploader to the front end?

I am using wp_insert_post and I would like to allow users to upload images as well as text. What would be the best way to go about this, without using a plugin?