This is a good source with part of the answer:http://www.visiblemantra.org/bija.html
Another explanation in a specific context:
The same sound may represent different things in different mantras. We mustn't forget that these are sounds rather than spending too much time focusing on scripts, and that these sounds and meanings need correct transmission from guru to disciple.
For appearance of Ham in Devanagari script, Google 'Devanagari Ham' and go to 'Images'.