It basically just a matter of writing PHP code that returns a string.
Say you create a snippet called MySnippet and put this tag on a page:
The tag will be replaced by whatever the snippet returns:
<?php
/* MySnippet */
$output = "Hello World!";
return $output;