It doesn't seem like there's much wrong with what you have above. This is what I typically do:
Which is pretty much the exact same thing you do. So my first guess would just be that you have a bug in your code somewhere - do you happen to have a line that says:
// make sure it worked okay
if ( !class_exists('Smarty') )
print "Whoops, no Smarty!";
// initialize smarty
$smarty = new Smarty();
$smarty->template_dir = "$templatedir";
$smarty->compile_dir = SMARTY_DIR . "templates_c";
$smarty->config_dir = SMARTY_DIR . "configs";
$smarty->cache_dir = SMARTY_DIR . "cache";
$smarty->assign( "var", "value!" );
$smarty->display( "main.tpl" );
'$smarty->template_dir = 'c:/wamp/www/smarty/templates';'
somewhere outside of your php tags? I really can't think of any other reason why it would output exactly that statement, other than having a mis-placed line of code outside of php tags, and therefore interpreted as plain text.