Effects of unearthed PSU and shielding on audio 50Hz hum
I don't know what "earth" you've used for the first experiment, so I'll [mostly] punt on that (for now). I suspect you have a SMPS with an Y-rated capacitor connecting its isolated side with the primary. This is permitted provided that leakage current is kept under control. It's done to reduce EMI from the power supply. You can look at this paper for example. Diagram from a better quality article



The tradeoff is that


  In general, the larger the
  value of the Y-capacitor, the
  lower the magnitude of the EMI
  that the supply generates. Conversely,
  the larger the value of
  the Y-capacitor, the higher will
  be the leakage current that
  flows across the isolation barrier.


Now onto your question:


  If I connect an unterminated 2 meter unbalanced ¼” jack cable to one of the inputs, I can hear lots of 50 Hz hum on the output. This is not surprising as the cable is acting as an antenna and the 0404 has high input impedance. However, when I connect the sleeve part of the jack to earth, most of the hum disappears. I can still increase the hum significantly by touching the tip of the jack with my finger.


Yes, the shielding does what it's supposed to on the cable itself. The 50Hz hum signal is low frequency, so it gets coupled into the shield and shorted to signal ground. This is electrostatic shielding i.e. negates capacitively coupled signals by shorting them back their source:



But you are not shielded and you are also capacitively coupled to the mains... as hard as that may seem to believe. (I'll add some youtube videos links about this once I find them. There sure must be some. N.B. Here's one: https://www.youtube.com/watch?v=c3SRuX9lW58) So you negate the effect of the cable shield when you touch the tip of the jack.


  If I remove the earth connection and insert the jack into a shielded but unearthed box, I can no longer detect the hum with my ears.


You need to clarify this experiment as well. How can you insert just the jack in a box? Do you mean the whole 0404 USB? Add a photo you can. Shielding without a ground (i.e. sans current return) connection is effective against electromagnetic (but not against electrostatic) interference/noise. I doubt however that simply shielding the jack can have the effect you describe, especially against low frequency noise like the mains frequency. I suggest this app note for more in-depth treatment of shielding (both electrostatic and electromagnetic). See also this answer and yet another app note that says not to bother much with anti-electromagnetic cable shielding as it's hard to achieve (instead simpler things like twisted cable pairs are more effective at negating that).