A series of novel ionic liquids composed of imidazolium, pyridinium, pyrrolidinium, and ammonium cations with tricyanomethanide or tetracyanoborate anions were prepared. The ionic liquids were characterized by NMR and IR spectroscopy and ESI-mass spectrometry, and their physical properties were investigated. Solid state structures of the N-propyl-N-methylpyrrolidinium and triethylpropylammonium tetracyanoborate salts were obtained by single crystal X-ray diffraction. The salts that are liquid at room temperature were evaluated as electrolyte additives in dye-sensitized solar cells, giving rise to efficiencies 7.35 and 7.85% under 100 and 10% Sun, respectively, in combination with the standard Z907 dye.