An example project in WordPress plugin form. Feel free to modify and abuse it however you like.
What it does, in essence, is define a metabox that will let you add a secondary image to a post or page. It does this in the same way the current featured image box does (ie. through the WordPress media library).