How to create a user object of a custom form and add a user in drupal 7?
You can save the details of the user in an array and can use "user_save" function to create new user.
You can get the values from the $form_state elements

    $details = array(
      'name' =&gt; '',
      'pass' =&gt; user_password(),
      'mail' =&gt; '',
      'init' =&gt; '',
      'status' =&gt; 1,
      'access' =&gt; REQUEST_TIME,
      'field_fname' =&gt; '',
      'field_lname' =&gt; '',
    );
    user_save(drupal_anonymous_user(), $details );


drupal_anonymous_user() will generate the default anonymous $user object.