In The Silmarillion, the Ainur were angelic beings (the name literally means "Holy Ones"), who were the first creations of Eru Iluvatar. He gave them music to play and sing, and to improvise on, and this music was later shaped into the world, after Eru Iluvatar put the Flame Imperishable into it. While the Ainur were blessed by God with many gifts, they did not have the power to create independent life. Some of the Ainur, led by Melkor, rebelled, disrupting the music and creation. However, Eru Iluvatar let some of them enter the world, becoming the Valar and the Maiar. All of this takes part in the first ten pages or so of the Silmarillion.
It is interesting to note, that like all of Tolkien's characters, the Ainur, who were seemingly pure spirits, and who were blessed with more wisdom and power than any of the other races that were created before or after, they are still morally fallible. Even while directly in the presence of Eru, they could still err.
Another note on the Ainur is that the term is often used interchangably with Valar and Maiar- the Ainur who chose to bind their fates to the world. It was said in the Silmarillion that "many" of the Ainur chose to do so, but the exact numbers that stayed outside of creation is not mentioned. It could have been around the same as the number that went in. In addition, no Ainur that did not become Valar or Maiar is described or named in the Silmarillion. It is, however, slightly possible that some Ainur entered the world without binding themselves as rulers to it, and I think that this may be one possibility of Tom Bombadil's nature.
I would also like to add that I am basing what I have written here on the published Silmarillion. From what I have read of the sources of the Silmarillion, the conception of the Ainur became more refined and philosophical as Tolkien's works progressed. For example, in the earlier works, there is reference to the Valar having children, something that was left out of the published Silmarillion.