My recollection is that VISA negotiated the contract directly with Costco, and they structured it to be profitable for the issuer. When Citi bought the accounts from American Express they paid a $1 billion premium over the outstanding balances, because of the amount of interest that Costco cardholders pay.
I've been told by people who should know the credit card business very well that Cit at best breaks even, due to low fees (no AF and very low negotiated interchange fee) and lower proportion of cardholders in the Costco portfolio carry balances.