An article by Ivan Komarov, explaining how to create UDFs for Firebird using C++, was published in The Code Project site.