An example plugin for how to include a metabox for attaching files to your WordPress posts outside of the media uploader.