Remote Entity Create with Node Reference
If you are using the entity api to create and save your entity its fairly easy:

// Create the node and wrap it in entity metadata wrapper
$node_create = entity_create('node', array('type' =&gt; 'my_content_type'):
$node_wrapper = entity_metadata_wrapper('node', $node_create);

$node_wrapper-&gt;title-&gt;value("My Title"); // Set the title
$node_wrapper-&gt;save(); // Node is now saved
$node_nid = $node_wrapper-&gt;getIdentifier(); // We now have the nid

// Doing the same thing here except adding the reference
$node_create2 = entity_create('node', array('type' =&gt; 'my_other_content_type'):
$node_wrapper2 = entity_metadata_wrapper('node', $node_create2);

$node_wrapper2-&gt;title-&gt;value("My referenced title");
$node_wrapper2-&gt;field_node_reference-&gt;value($node_nid);

$node_wrapper2-&gt;save();