You can use CSS alone if you don’t mind the styling only aplying to the more modern browsers.
ul#somemenu > li:first-child { }
ul#somemenu > li:last-child { }
Or you could use some jQuery to add additional classes..
<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready( function($) {
$('#somemenu > li:first-child').addClass('first-item');
$('#somemenu > li:last-child').addClass('last-item');
} );
/* ]]> */
</script>
jQuery won’t have the same browser limitations, but obviously will mean loading jQuery frontside (if plugins or the theme are already doing this it should have minimal impact on load times).
Now you have 3 different approaches.. 😉