A tutorial explaining how to create an events post type, complete with custom meta boxes and an example query. There’s also an example plugin that can be downloaded from GitHub.
Portfolio Post Type Plugin
I recently released a plugin to WordPress.org that registers a portfolio post type, related taxonomies, and adds an image when you’re viewing the items in the dashboard. Here’s a walk through of the code involved.