The Abudarham (Spain, 14th century), as cited by Rabbi Yaakov Hayim Sofer in his work Kaf Ha'chayim (417:1; listen to audio for precise citation), records the custom to announce on the Shabbat preceding Rosh Chodesh when during the week Rosh Chodesh will occur. This announcement is made after the reading of the Haftara, before the recitation of Ashrei.
It is customary to recite in conjunction with this announcement a special "Yehi Ratzon" prayer on behalf of the Rabbis, their families and their students. The Kaf Ha'chayim explains (citing again from the Abudarham) that we recite this prayer because in ancient times, the onset of the new month was determined by the Rabbinic scholars based on their calculations and testimony they would hear to the sighting of the new moon. It is therefore appropriate as we commemorate the ancient ceremony of "Kiddush Ha'chodesh" ("sanctifying" the new month) to offer a prayer on behalf of the Rabbis.
Is one required to stand during the Rosh Chodesh announcement?
The Kaf Ha'chayim (417:7) cites the ruling of the Magen Avraham (commentary to the Shulchan Aruch by Rabbi Avraham Gombiner, Poland, 1637-1683) that one must, in fact, stand as the Chazan announces Rosh Chodesh. In ancient times, when the Rabbinical Court would declare the onset of the new month, the people around them would stand and declare, "Mekudash," and therefore we, too, should stand as we commemorate this ceremony. This is the ruing as well of Rabbi Moshe Feinstein (Russia-New York, 1895-1986), in his work Iggerot Moshe (O.C. 1:142). Some communities, however, such as those from Aram Soba, have the practice to sit during the announcement of Rosh Chodesh, and each community should follow their custom.
Finally, the Kaf Ha'chayim (417:9) writes that everyone in the congregation should declare the Rosh Chodesh announcement along with the Chazan. It is incorrect, he emphasizes, for people to simply listen to the Chazan's announcement; everyone must join with the Chazan in announcing when Rosh Chodesh will be observed.
Summary: On the Shabbat immediately preceding Rosh Chodesh, the Chazan makes an announcement after the Haftara reading informing the congregation when Rosh Chodesh will be observed during the week, and everyone should make this announcement together with the Chazan. It is customary to recite a special prayer for the Rabbis in conjunction with this announcement. Some communities stand during this announcement, while others sit; each community should follow its custom.