You can use Theme Switch and Preview.
If you are up for coding this yourself, you can use the template
and stylesheet
filters.
E.g.: to switch to Twenty Ten:
function custom_load_twenty_ten_template() {
return 'twentyten';
}
function custom_load_twenty_ten_stylesheet() {
return 'twentyten';
}
add_filter( 'template', 'custom_load_twenty_ten_template' );
add_filter( 'stylesheet', 'custom_load_twenty_ten_stylesheet' );