You can add a direction form at a marker in a kml file. You have to add the following html:

<div>
    <form action='http://maps.google.com/maps' method='get' target='_blank' class='mapdirform'>
        <br />
        Directions to here<br />
        Address:
        <input type='text' class='inputbox' size='20' name='saddr' id='saddr' value='' />
        <br />
        <input value='Get Directions' class='button' type='submit' style='margin-top: 2px;' />
        <input type='hidden' name='daddr' value='address' />
    </form>
</div>

Replace address with the coordinates or address where the marker is placed. 

Example: 

{mosmap kml='http://tech.reumer.net/images/testroute.kml'}

This can cause a problem with the infowindow in Firefox when combining with dir=1 and KML renderer Geoxml.