When using PF and ALTQ in FreeBSD and using more than 64 queues you must increase the number of queues complied in the kernel. If you have more then 64 queues you will get the following error.
DIOCADDALTQ: Cannot allocate memory
To increase the number of queues edit /usr/src/sys/contrib/altq/altq/altq_hfsc.h and change the value
#define HFSC_MAX_CLASSES 64
Make the value equal to or greater then the number of queues you will use in the pf.conf file. After you have change the file you will need to recompile your kernel. See http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-building.html for information on how to recompile your kernel.