How does the Asus transformer keyboard dock work? From a software and hardware standpoint, what kind of interface does the keyboard use? I'm guessing it's not just a usb-hid interface, or if it is there's something special for the special keys. 

If I were to make my own device like that, say based on an Android sbc, what would I have to do to replicate it?
It appears to be an I2C interface. According to this post on xda-developers asusdec is the name of the keyboard dock device. When I cat /proc/bus/input/devices on my Transformer, this is what it says about asusdec:

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="asusdec"
P: Phys=/dev/input/asusdec
S: Sysfs=/devices/platform/tegra-i2c.1/i2c-1/1-0019/input/input15
U: Uniq=
H: Handlers=sysrq event3 
B: PROP=0
B: EV=20003
B: KEY=3fffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe
B: LED=2


Also, ps shows a com.asus.keyboard process running as system. That's an Android process. I'm not sure how exactly it's getting the input from the keyboard, though. I assume it has sufficient permissions to open the device for reading and converts the incoming keycodes to Android events.