Use profile2 fields in custom form
Solved it with the following code:

function custom_form($form, &amp;$form_state) {        

global $user;

if (!isset($form_state['profiles'])) {

  $profile = profile2_load_by_user($user, 'profile_machine_name');
  if (!$profile) 
  {
    $profile = profile_create(array(
      'type' =&gt; 'profile_machine_name',
      'uid' =&gt; $user-&gt;uid
    ));
  }
  $form_state['profiles'][$profile-&gt;type] = $profile;
}

profile2_attach_form($form, &amp;$form_state);

$form['submit'] = array(
  '#type' =&gt; 'submit',
  '#value' =&gt; t('Save'),
);
return $form;
}