How to render custom entity
if you are using Entity API, you can take a look to this article http://www.trellon.com/content/blog/creating-own-entities-entity-api and to the example_task module:

The process works like this:

  // Your entity view path
  $task_uri = 'task/%example_task';
  $task_uri_argument_position = 1;

  $items[$task_uri] = array(
    'title callback' =&gt; 'entity_label',
    'title arguments' =&gt; array('example_task', $task_uri_argument_position),
    'page callback' =&gt; 'example_task_view',
    'page arguments' =&gt; array($task_uri_argument_position),
    'access callback' =&gt; 'entity_access',
    'access arguments' =&gt; array('view', 'example_task', $task_uri_argument_position),
    'file' =&gt; 'example_task.pages.inc',
  );

/**
 * Task view callback.
 */
function example_task_view($task) {
  drupal_set_title(entity_label('example_task', $task));
  return entity_view('example_task', array(entity_id('example_task', $task) =&gt; $task), 'full');
}


This will invoke to the function in entity/includes/entity.controller.inc folder of Entity API module:

  /**
   * Implements EntityAPIControllerInterface.
   */
  public function view($entities, $view_mode = 'full', $langcode = NULL, $page = NULL) {
    // For Field API and entity_prepare_view, the entities have to be keyed by
    // (numeric) id.
    $entities = entity_key_array_by_property($entities, $this-&gt;idKey);
    if (!empty($this-&gt;entityInfo['fieldable'])) {
      field_attach_prepare_view($this-&gt;entityType, $entities, $view_mode);
    }
    entity_prepare_view($this-&gt;entityType, $entities);
    $langcode = isset($langcode) ? $langcode : $GLOBALS['language_content']-&gt;language;

    $view = array();
    foreach ($entities as $entity) {
      $build = entity_build_content($this-&gt;entityType, $entity, $view_mode, $langcode);
      $build += array(
        // If the entity type provides an implementation, use this instead the
        // generic one.
        // @see template_preprocess_entity()
        '#theme' =&gt; 'entity',
        '#entity_type' =&gt; $this-&gt;entityType,
        '#entity' =&gt; $entity,
        '#view_mode' =&gt; $view_mode,
        '#language' =&gt; $langcode,
        '#page' =&gt; $page,
      );
      // Allow modules to modify the structured entity.
      drupal_alter(array($this-&gt;entityType . '_view', 'entity_view'), $build, $this-&gt;entityType);
      $key = isset($entity-&gt;{$this-&gt;idKey}) ? $entity-&gt;{$this-&gt;idKey} : NULL;
      $view[$this-&gt;entityType][$key] = $build;
    }
    return $view;
  }
}


As you can see the content is finally rendered through a render element using "Entity.tpl.php"

A way to add your customizations to the view in order to render elements which are not fields may be extending from "EntityAPIController" and writing builContent function:

class ExampleTaskController extends EntityAPIController {

      public function buildContent($entity, $view_mode = 'full', $langcode = NULL, $content = array()) {
        $wrapper = entity_metadata_wrapper('example_task', $entity);
        $content['author'] = array('#markup' =&gt; t('Created by: !author', array('!author' =&gt; $wrapper-&gt;uid-&gt;name-&gt;value(array('sanitize' =&gt; TRUE)))));

        // Make Description and Status themed like default fields.
        $content['description'] = array(
          '#theme' =&gt; 'field',
          '#weight' =&gt; 0,
          '#title' =&gt;t('Description'),
          '#access' =&gt; TRUE,
          '#label_display' =&gt; 'above',
          '#view_mode' =&gt; 'full',
          '#language' =&gt; LANGUAGE_NONE,
          '#field_name' =&gt; 'field_fake_description',
          '#field_type' =&gt; 'text',
          '#entity_type' =&gt; 'example_task',
          '#bundle' =&gt; $entity-&gt;type,
          '#items' =&gt; array(array('value' =&gt; $entity-&gt;description)),
          '#formatter' =&gt; 'text_default',
          0 =&gt; array('#markup' =&gt; check_plain($entity-&gt;description))
        );

        return parent::buildContent($entity, $view_mode, $langcode, $content);
      }
    }