How to theme a custom object from an external datasource?
You should use hook_theme() for that:


  Register a module (or theme's) theme implementations.
  
  The implementations declared by this hook have two purposes: either they specify how a particular render array is to be rendered as HTML (this is usually the case if the theme function is assigned to the render array's #theme property), or they return the HTML that should be returned by an invocation of theme(). See Using the theme layer Drupal 7.x for more information on how to implement theme hooks.