The first official module we’ve developed for Drupal has been approved on Drupal.org. The Claim on Registration module allows anonymous users to create content and then automatically claim it upon successful registration.
The module allow anonymous user to create content which you set permission for. The module simply sets a cookie to the new id. The user registers or logs in. The created node(s) will be assigned to the user after logging in or registration. At this point when the user is assigned the content this module provides a hook which passes the node object with the updated user id.
You can download the module and find out more on the project page @ the official drupal.org website.