As Tyler pointed out, what you want isn't a good idea, but to answer your question, here is some code that should get you started:
##Generate some data
heights = runif(15)
heights = heights/sum(heights)
dd = data.frame(heights, type=1:3)
m_heights = tapply(dd$heights, dd$type, mean)
The trick is to generate empty bars when adding your second barplot:
##rep(0, 5) is used to pad
h = c(rep(0,5), heights[1:5], rep(0,5), heights[6:10], rep(0,5), heights[11:15])
barplot(m_heights, width=1, space=1, ylim=c(0, max(dd$heights)), xlim=c(0, 6))
barplot(h, width=0.2,space=0,add=T, col="white", border=NULL)
However, a much better plot is just a plain scatter plot of the data
plot(dd$type, dd$heights)
We can even add on the means:
points(1:3, m_heights, col=2, pch="X")