The short answer is that you would want to use the net inflow or net outflow, aka profit or loss.
In my experience, you've got a couple different uses for IRR and that may be driving the confusion. Pretty much the same formula, but just coming at it from different angles.
Thinking about a stock or mutual fund investment, you could project a scenario with an up-front investment (net outflow) in the first period and then positive returns (dividends, then final sale proceeds, each a net inflow) in subsequent periods. This is a model that more closely follows some of the logic you laid out.
Thinking about a business project or investment, you tend to see more complicated and less smooth cashflows. For example, you may have a large up-front capital expenditure in the first period, then have net profit (revenue less ongoing maintenance expense), then another large capital outlay, and so on.
In both cases you would want to base your analysis on the net inflow or net outflow in each period. It just depends on the complexity of the cashflows trend as to whether you see a straightforward example (initial payment, then ongoing net inflows), or a less straightforward example with both inflows and outflows.
One other thing to note - you would only want to include those costs that are applicable to the project. So you would not want to include the cost of overhead that would exist even if you did not undertake the project.