The only good way to do this is to rearrange your data to suit the needs of the 'ggplot' function. However, if you want to do it all in line, you can. You'll just have to reshape the data by hand, like so:
ggplot(data=data.frame(value=c(d$A, d$B), variable=c(rep("A",10),rep("B",10))), aes(x=c(1:10,1:10), y=value, fill=variable))+geom_bar(stat="identity", position="dodge")
Here, I have created a new data frame out of the old one and assigned the corresponding variable names (this is what the 'reshape2' package does with the 'melt' function). Then, I have manually assigned the x-values to be 1:10 for "A" and 1:10 for "B" to make the bars appear next to each other, rather than all in order from 1:20. I added a 'fill' argument to change the colors of the bars to represent "A" or "B".