Set the active Navigation Menu from a plugin

You can use the wp_nav_menu_args filter ( Codex reference ) to set a theme location to use a specific menu.

Example:

function test_wp_nav_menu_args( $args="" ) {
    // only set menu for the primary navigation menu.
    if ( $args['theme_location'] != 'primary' ) {
        return $args;
    }
    // change {main-menu} to be the slug of the menu you want to set.
    $args['menu'] = 'main-menu';
    return $args;
}
add_filter( 'wp_nav_menu_args', 'test_wp_nav_menu_args' );