Examples of how economists come up with a production function for a firm?
The "production function" in economics and econometrics is not an engineering concept. It is a highly abstract construction where the myriads of inputs used are lumped together in very few categories: "capital" and "labor" being the most usual ones, while sometimes inputs critical to an industry like say "Energy" may be singled out and appear in the production-function formulation. At such an abstract level, it is easily implementable without the need to go into particulars of each firm.

Moreover, in many if not most of the cases, what is modeled is the production of value added, not the total output (either in quantities or in values).  

Applied work commissioned by specific (usually very large) firms, and also, applied research into "adjustment costs" or what is called "insider econometrics", may go some steps towards creating much more complex production functions, that essentially try to take into account the actual physical relations and interactions between the various inputs. But these are very specialized areas -remember that the Economics discipline ultimately is about markets and economic systems -the "individual" (firm or person) level is researched mainly in order to have sound foundations for the aggregation that follows.