How can I add a class to a link output via a form?
Take a look at the l() function:

l(t('link_text'), 'path', array('attributes' =&gt; array('class' =&gt; array('your_class'), 'id' =&gt; 'your_id')));