This article assumes that you have already installed the drivers for your card

First grab the card and device number

 [email protected]:~$ sudo aplay -l
[sudo] password for cereal:
**** List of PLAYBACK Hardware Devices ****
Home directory /home/cereal not ours.
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0 

So for me, hdmi is card 0 device 3. To make ensure that your drivers are working properly find a wave file and run

sudo aplay -D plughw:0,3 sweet-wave-test-file.wav

If you hear the file, GG, if you don't, go back to the drawing board, ensure that alsamixer is not muted/try proprietary drivers/etc

Next, edit or create /etc/asound.conf with the following infos

pcm.!default {
type hw
card 0
device 3
}

Note that you will also need to replace the card and device # with what is found in the output of aplay -l

Jump over to xbmc -> Settings -> System -> Audio
Change both the passthrough and audio device to custom with the following paramaters

plughw:0,3

Again, replace 0,3 with your actual set up. Reboot and get a life