The consular process starts with an immigrant petition (such as I-130 alien relative petition or I-140 petition for alien worker) being filed with USCIS in the United States. Of course, an investor's petition, as well as I-360 self-petition may be good reasons for immigrant visas as well. Once an immigrant petition is approved, it would be transferred in most cases to the National Visa Center or NVC that acts as a "middle man" between USCIS, a beneficiary, and a consulate overseas.
What documents NVC requires a petition visa beneficiaries to submit, what determines a post or location for the Immigrant visa interview, and when a visa registration can be terminated is discussed in detail in detail by our New York Immigration lawyer in here, in her article Consular Process.