You can use the GD library to draw the signature:
Take a look at the many examples and test them out to get the hang of how it works.
When you know how to work the API, design something nice in your favorite graphics editor, export it to a PNG file, load it in with GD in your script, and manually position all the text and such. After you're all done, you might want to convert the PNG file to a GD file (you can do that with PHP's GD library too) for performance reasons (though I don't know if it has a noticeable effect).
To take in a USN, you just use $_GET like you would normally. In the image you linked, it doesn't have a query part in the URL though. If you use Apache, you can use mod_rewrite to fake URLs and make them redirect to your script (#####.png => signature.php?usn=#####). Shove this into a .htaccess file:
(After you get all of this working, you want to save the signature images to disk temporarily because it's costly to have to re-generate this image every time. To save bandwidth, there are some HTTP headers that you want to send to make browsers cache your image, but you can ask about these things later.)
RewriteRule ^([0-9]+)\.png$ signature.php?usn=$1 [QSA,L]