When you work with electronics, firmware development is inevitable and it is very beneficial to have your own engineering team working on it.
In a long-term perspective, as with any other software development, except fixing bugs, releasing new versions, dealing with memory leaks, technical support, etc. The major ongoing expenses you would face are salaries.
An average annual salary of the firmware engineer (C++) in the US ranges from $90,000 to $145,000 per year according to Glassdoor
You would also need resources to test the firmware. Count in another QA specialist or trust your engineers :).
An important element to consider is integrating firmware over-the-air updates (OTA or FOTA) from the very beginning. It can mitigate a lot of issues, (but can also create a lot of trouble when executed poorly).
FOTA technology allows manufacturers to remotely install new software, release patches and bug fixes, or update features and services after the device has been deployed to the jobsite, home, or office. FOTA involves recurring costs mostly on the Cloud side. Often this functionality is covered by IoT platforms.