How to add extra class in main menu?
You can use Menu Attributes Module to add classes.


  This simple module allows you to specify some additional attributes
  for menu items such as id, name, class, style, and rel.


To custom code it, you can add class to menu links using hook_menu_link_alter . Try something like this:

$item['options']['attributes']['class'] = array('class-one' , 'class-two');