Better to put your data in the long format :
library(plyr)
library(reshape2)
xx <- melt(test,measure.vars=paste0('val',1:3))
ddply(xx,.(variable),function(x){
coef(glm.nb(value~.,data=subset(x,select=-variable)))
})
variable (Intercept) a b c d
1 val1 1.583602 -0.045909060 -0.018189342 0.026293033 0.29708648
2 val2 2.704601 -0.014641683 -0.003836401 0.006711503 0.10445377
3 val3 3.217729 -0.008925782 -0.001863267 0.003475509 0.06292286
If you want all the model not just the coefficients:
dlply(xx,.(variable),function(x){
glm.nb(value~.,data=subset(x,select=-variable))
})