How can the output of an unconfirmed transaction be spent? This transaction has been stuck for a few days:

af660c5eafe582f22254c9778d18a628d1d2fdea812e983713379458b7c2c9df

https://blockchain.info/tx/af660c5eafe582f22254c9778d18a628d1d2fdea812e983713379458b7c2c9df

How is it possible that one of the outputs is spent if the transaction is unconfirmed?
It works just fine.  "Spent" here just means that a second transaction has been broadcast whose input is an output of the first transaction.  You don't have to wait for confirmation in order to do that, and you can continue the process with arbitrarily long chains.

However, the second transaction can't be confirmed until after the first one is confirmed.  (Or, they can both be confirmed in the same block.)