Have a look to the EDLUT (event-driven look-up table) simulator in http://edlut.googlecode.com. That simulator (C++) implements an event-driven simulation engine and precompiles the neuron equations in look-up tables to speed up the simulation. LIF cell models and STDP are already implemented in EDLUT and can be used in the arbitrary networks that you may define. Interfaces with C/C++, Python, Matlab and Simulink are available, so EDLUT simulations can be run directly from Matlab.
I attach the last paper we have published where it is explained how event-driven and time-driven cell models can run together in the same EDLUT network.
Article A Spiking Neural Simulator Integrating Event-Driven and Time...
@Timothée: I would be really grateful if you could provide me your code. I was looking for a generic solution. Anyway, I hope to be able to adapt the code.
@Jesús: thanks for the tip. I will give a look to the simulator. However, I am trying to implement the STDP with a different kind of neuron model.