Muchas gracias por el aporte.
Para los que usamos Delphi en vez de C++ Builder, les dejo la "traducción" de la función a Pascal.
Código Delphi
[-]function TForm1.Generar_IBAN(Pais, Cuenta: string): string;
function EsAlfanumerico(Caracter: Char): boolean;
begin
Result := (AnsiChar(Caracter) in ['A'..'Z', 'a'..'z']);
end;
function EsNumerico(Caracter: Char): boolean;
begin
Result := (AnsiChar(Caracter) in ['0'..'9']);
end;
var cAux, AuxCuenta:string;
i:Integer;
auxTemp: Extended;
begin
if (Trim(Cuenta) = '') or (Length(Cuenta) > 34)
then Result := ''
else begin
Cuenta := UpperCase(Cuenta);
AuxCuenta := Cuenta;
cAux := '';
for i := 1 to Length(Cuenta) do
if (EsAlfanumerico(Cuenta[i]) or EsNumerico(Cuenta[i]))
then cAux := cAux + AnsiString(Cuenta[i]);
Cuenta := cAux;
if (EsAlfanumerico(Cuenta[1]) and EsAlfanumerico(Cuenta[2])) then begin
if (EsAlfanumerico(Cuenta[3]) or EsAlfanumerico(Cuenta[4]))
then Result := '';
Cuenta := Copy(Cuenta, 5, Length(Cuenta)); Pais := Copy(Cuenta, 1, 2); end
else begin
if (Trim(Pais) = '') then Pais := 'ES';
Cuenta := Cuenta + Pais + '00';
end;
cAux := '';
for i := 1 to Length(Cuenta) do
begin
if (EsAlfanumerico(Cuenta[i]))
then cAux := cAux + FormatFloat('00', Ord(Cuenta[i])-55) else cAux := cAux + Copy(Cuenta, i, 1);
end;
Cuenta := cAux;
auxTemp := StrToInt(Copy(Cuenta, 1, 9)) mod 97;
cAux := FormatFloat('0', auxTemp); Cuenta := Copy(Cuenta, 10, Length(Cuenta)); while (Trim(Cuenta) <> '') do
begin
if (StrToInt(cAux) < 10)
then begin
cAux := cAux + Copy(Cuenta, 1, 8); Cuenta := Copy(Cuenta, 9, Length(Cuenta)); end
else begin
cAux := cAux + Copy(Cuenta, 1, 7); Cuenta := Copy(Cuenta, 8, Length(Cuenta)); end;
auxTemp := StrToInt(cAux) mod 97;
cAux := FormatFloat('0', auxTemp);
end;
Result := Pais + FormatFloat('00', 98 - StrToInt(cAux)) + AuxCuenta;
end;
end;
end;