Suppose you have a code like this.
$node = entity_create('node', array('type' => 'info'));
$entity = entity_metadata_wrapper('node', $node);
// Node title.
$entity->title = $info->name;
// Address.
$entity->field_info_address->thoroughfare = $info->address;
$entity->field_info_address->locality = $info->city;
$entity->field_info_address->administrative_area = $info->state;
$entity->field_info_address->postal_code = $info->postalcode;
$entity->field_info_address->country = $info->country;
// Save the entity.
$entity->save();
Now for some reason you have to obtain the node id of the entity. You have two options:
Option 1:
$entity->save();
// Get the entity id.
$nid = $entity->nid->value();
Option 2 (Recommended way):
$entity->save();
// Get the entity id.
$nid = $entity->getIdentifier();