Thanks geekosaur, nice code - I used this but it took a while to figure out how to get it working. Here's how I did it in Ubuntu 11.10 - it works in the bash terminal:
comm -13 \
<(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort) \
<(comm -23 \
<(dpkg-query -W -f='${Package}\n' | sed 1d | sort) \
<(apt-mark showauto | sort) \
) > user-installed-packages
Then to add a tab - '\t' - and 'install' on each line:
sed 's/$/\tinstall/' user-installed-packages >uip
Then on the new machine:
sudo dpkg --set-selections < uip
And to install the packages:
sudo apt-get dselect-upgrade