Trying to modify Main menu by testing $vars['heading']['text'] == 'Main menu',
You can do it by using this code in template.php file of your active theme.

function mytheme_links__system_main_menu($variables) {
  $html = "&lt;div class='myclass'&gt;";
  $html .= "  &lt;ul&gt;";  
  foreach ($variables['links'] as $link) {
    $html .= "&lt;li&gt;".l($link['title'], $link['path'], $link)."&lt;/li&gt;";
  }
  $html .= "  &lt;/ul&gt;";
  $html .= "&lt;/div&gt;";

  return $html;
} 


or you can add customization in $variables also if we have do minor customization to do.
Here replace mytheme with name of your theme.
Clear you cache after using this code.

Hope it will help you!